# == Class httpproxy::params
#
# This class is meant to be called from httpproxy
# It sets variables according to platform
#
class httpproxy::params {
  case $::osfamily {
    'Debian', 'Ubuntu': {
      $package_name  = 'squid3'
      $service_name  = 'squid3'
      $config_file   = '/etc/squid3/squid.conf'
      $log_directory = '/var/log/squid3'
      $coredump_dir  = '/var/spool/squid3'
    }
    'RedHat', 'Amazon': {
      $package_name  = 'squid'
      $service_name  = 'squid'
      $config_file   = '/etc/squid/squid.conf'
      $log_directory = '/var/log/squid'
      $coredump_dir  = '/var/spool/squid'
    }
    default: {
      fail("${::operatingsystem} not supported")
    }
  }
  $access_log                    = [ "${log_directory}/access.log squid" ]
  $cache_log                     = "${log_directory}/cache.log"
  $cache_store_log               = "${log_directory}/store.log"

  # use white list
  $acl         = [ 'whitelist dstdomain "/etc/squid3/whitelist"' ]
  $http_access = [ 'deny !whitelist' ]

  # disable cache
  $cache = [ 'deny all' ]

  # default settings
  $http_port                     = [ '3128' ]
  $cache_mem                     = '256 MB'
  $via                           = 'on'
  $ignore_expect_100             = 'off'
  $cache_mgr                     = 'root'
  $forwarded_for                 = 'on'
  $client_persistent_connections = 'on'
  $server_persistent_connections = 'on'
  $icp_access                    = []
  $tcp_outgoing_address          = []
  $maximum_object_size           = '4096 KB'
  $maximum_object_size_in_memory = '512 KB'
  $cache_dir                     = []
  $refresh_patterns              = []
  $config_hash                   = {}
}
